import VueRouter from "vue-router";
import Index from '../view/Index/Index.vue'

const router =  new VueRouter({
    routes: [
        {
            path: '/',
            name: 'Index',
            component: Index,
            children: [
                {
                    path: 'login',
                    name: 'Login',
                    component: () => import('@/view/Account/Login.vue')
                },
                {
                    path: 'register',
                    name: 'Register',
                    component: () => import('@/view/Account/Register.vue')
                },
                {
                    path: 'forgetPassword',
                    name: 'ForgetPassword',
                    component: () => import('@/view/Account/ForgetPassword.vue')
                },
                {
                    path: 'user',
                    name: 'User',
                    // components: {User: () => import('@/view/User/User.vue')} 
                    component: () => import('@/view/User/User.vue'),
                    
                },
                {
                    path: 'cars',
                    name: 'Car',
                    // components: {Car: () => import('@/view/Car/Car.vue')}
                    component: () => import('@/view/Car/Car.vue')
                },
                {
                    path: 'safe',
                    name: 'Safe',
                    // components: {Safe: () => import('@/view/Safe/Safe.vue')}
                    component: () => import('@/view/Safe/Safe.vue')
                },
                {
                    path: 'updatePassword',
                    name: 'UpdatePwd',
                    component: () => import('@/view/Safe/UpdatePwd.vue')
                },
                {
                    path: 'bindPhone',
                    name: 'BindPhone',
                    component: () => import('@/view/Safe/BindPhone.vue')
                },
                {
                    path: 'moneyCode',
                    name: 'MoneyCode',
                    component: () => import('@/view/Safe/MoneyCode.vue')
                },
                {
                    path: 'bindBankCard',
                    name: 'BindBankCard',
                    component: () => import('@/view/Safe/BindBankCard.vue')
                },
                {
                    path: 'addBankCard',
                    name: 'AddBankCard',
                    component: () => import('@/view/Safe/AddBankCard.vue')
                },
                {
                    path: 'authentication',
                    name: 'Authentication',
                    component: () => import('@/view/Authentication/Authentication.vue')
                },
                {
                    path: 'tent',
                    name: 'Tent',
                    component: () => import('@/view/Authentication/Tent.vue')
                },
                {
                    path: "account",
                    name: "Account",
                    component: () => import("@/view/Account/Account.vue")
                },
                {
                    path: "recharge",
                    name: "Recharge",
                    component: () => import("@/view/Account/Recharge.vue")
                },
                {
                    path: "order",
                    name: "Order",
                    component: () => import("@/view/Order/index.vue")
                },
                {
                    path: "payStatus",
                    name: "PayStatus",
                    component: () => import("@/view/Account/PayStatus.vue")
                },
                {
                    path: "payResult",
                    name: "PayResult",
                    component: () => import("@/view/Account/PayResult.vue")
                },
            ]
        },
        {
            path: '/index',
            redirect: '/'
        }
    ],
})

export default router